using System;
using System.Collections.Generic;
using System.Text;

using PickGold;
using PickGold.Database;
using PickGold.Entities.Table;

namespace PickGold.Entities.View
{
    public class CViewNotifyInfo : CBaseView
    {
        //
        public const string ENTITY_NAME = "vw_sys_notify_info";
        public const string ENTITY_ALIAS = "notifies";
        // tb_sys_notify_info
        public const string SURA_ID = CBaseSuraInfo.ENTITY_KEY;
        public const string ROLE_ID = CBaseRoleInfo.ENTITY_KEY;
        public const string USER_ID = CBaseUserInfo.ENTITY_KEY;
        public const string USER_AUDIT = "user_audit";
        public const string MIME_ID = CBaseMimeInfo.ENTITY_KEY;
        public const string FILE_ID = CBaseFileInfo.ENTITY_KEY;
        public const string ITEM_VALUE = "item_value";
        public const string ITEM_ORIGIN = "item_origin";
        public const string ITEM_REVERT = "item_revert";
        public const string ITEM_REVIEW = "item_review";
        public const string ITEM_CREATE = "item_create";
        public const string ITEM_AUDIT = "item_audit";
        //
        public const string SURA_NAME = CBaseSuraInfo.ENTITY_SYMBOL;
        public const string ROLE_NAME = CBaseRoleInfo.ENTITY_SYMBOL;
        public const string USER_NAME = CBaseUserInfo.ENTITY_SYMBOL;
        public const string FILE_MIME = "file_mime";
        public const string FILE_NAME = CBaseFileInfo.ENTITY_SYMBOL;
        //
        private SViewNotifyInfo _ = null;
        //
        public CViewNotifyInfo() : base(ENTITY_NAME, ENTITY_ALIAS) { }
        public CViewNotifyInfo(CDatabase db) : base(db, ENTITY_NAME, ENTITY_ALIAS) { }
        public CViewNotifyInfo(string alias) : base(ENTITY_NAME, alias) { }
		public CViewNotifyInfo(CDatabase db, string alias) : base(db, ENTITY_NAME, alias) { }
        //
        protected override void SetSchema()
        {
			this.SetSchema(new SViewNotifyInfo());
        }
		protected void SetSchema(SViewNotifyInfo s)
        {
            this._ = s;
            base.SetSchema(s);
        }
        //
        protected override void PreInitSchema()
        {
            base.PreInitSchema();
			// tb_sys_notify_info
            this._DataTable.Columns.Add(SURA_ID, typeof(long)).DefaultValue = this._.SuraID;
            this._DataTable.Columns.Add(ROLE_ID, typeof(long)).DefaultValue = this._.RoleID;
            this._DataTable.Columns.Add(USER_ID, typeof(long)).DefaultValue = this._.UserID;
            this._DataTable.Columns.Add(USER_AUDIT, typeof(long)).DefaultValue = this._.UserAudit;
            this._DataTable.Columns.Add(MIME_ID, typeof(long)).DefaultValue = this._.MimeID;
            this._DataTable.Columns.Add(FILE_ID, typeof(long)).DefaultValue = this._.FileID;
            this._DataTable.Columns.Add(ITEM_VALUE, typeof(string)).MaxLength = 8000;
            this._DataTable.Columns.Add(ITEM_ORIGIN, typeof(string)).MaxLength = 256;
            this._DataTable.Columns.Add(ITEM_REVERT, typeof(int)).DefaultValue = this._.ItemRevert;
            this._DataTable.Columns.Add(ITEM_REVIEW, typeof(int)).DefaultValue = this._.ItemReview;
            this._DataTable.Columns.Add(ITEM_CREATE, typeof(DateTime)).DefaultValue = this._.ItemCreate;
            this._DataTable.Columns.Add(ITEM_AUDIT, typeof(DateTime)).DefaultValue = this._.ItemAudit;
        }
        //
        #region Property
		//
		#region tb_sys_notify_info
		//
        public long SuraID
        {
            set
            {
                this._.SuraID = value;
                this.SetValue(SURA_ID, value);
            }
            get
            {
                return this._.SuraID;
            }
        }
        //
		public long RoleID
        {
            set
            {
                this._.RoleID = value;
                this.SetValue(ROLE_ID, value);
            }
            get
            {
				return this._.RoleID;
            }
        }
        //
        public long UserID
        {
            set
            {
                this._.UserID = value;
                this.SetValue(USER_ID, value);
            }
            get
            {
                return this._.UserID;
            }
        }
        //
        public long UserAudit
        {
            set
            {
                this._.UserAudit = value;
                this.SetValue(USER_AUDIT, value);
            }
            get
            {
                return this._.UserAudit;
            }
        }
        //
        public long MimeID
        {
            set
            {
                this._.MimeID = value;
                this.SetValue(MIME_ID, value);
            }
            get
            {
                return this._.MimeID;
            }
        }
        //
        public long FileID
        {
            set
            {
                this._.FileID = value;
                this.SetValue(FILE_ID, value);
            }
            get
            {
                return this._.FileID;
            }
        }
        //
        public string ItemValue
        {
            set
            {
                this._.ItemValue = value;
                this.SetValue(ITEM_VALUE, value);
            }
            get
            {
                return this._.ItemValue;
            }
        }
        //
        public string ItemOrigin
        {
            set
            {
                this._.ItemOrigin = value;
                this.SetValue(ITEM_ORIGIN, value);
            }
            get
            {
                return this._.ItemOrigin;
            }
        }
        //
        public int ItemRevert
        {
            set
            {
                this._.ItemRevert = value;
                this.SetValue(ITEM_REVERT, value);
            }
            get
            {
                return this._.ItemRevert;
            }
        }
        //
        public int ItemReview
        {
            set
            {
                this._.ItemReview = value;
                this.SetValue(ITEM_REVIEW, value);
            }
            get
            {
                return this._.ItemReview;
            }
        }
        //
        public DateTime ItemCreate
        {
            set
            {
                this._.ItemCreate = value;
                this.SetValue(ITEM_CREATE, value);
            }
            get
            {
                return this._.ItemCreate;
            }
        }
        //
        public DateTime ItemAudit
        {
            set
            {
                this._.ItemAudit = value;
                this.SetValue(ITEM_AUDIT, value);
            }
            get
            {
                return this._.ItemAudit;
            }
        }
        //
        #endregion
        //
        #endregion
        //
        public override bool MoveTo(int position)
        {
            if (!base.MoveTo(position))
                return false;
			// tb_sys_notify_info
            this._.SuraID = this.GetValue<long>(SURA_ID);
            this._.RoleID = this.GetValue<long>(ROLE_ID);
            this._.UserID = this.GetValue<long>(USER_ID);
            this._.UserAudit = this.GetValue<long>(USER_AUDIT);
            this._.MimeID = this.GetValue<long>(MIME_ID);
            this._.FileID = this.GetValue<long>(FILE_ID);
            this._.ItemValue = this.GetValue<string>(ITEM_VALUE);
            this._.ItemOrigin = this.GetValue<string>(ITEM_ORIGIN);
            this._.ItemCreate = this.GetValue<DateTime>(ITEM_CREATE);
            this._.ItemAudit = this.GetValue<DateTime>(ITEM_AUDIT);
            //
            return true;
        }
        //
    }
    //
	public class SViewNotifyInfo : SBaseView
    {
        // tb_sys_notify_info
        public long SuraID = -1;
        public long RoleID = -1;
        public long UserID = -1;
        public long UserAudit = -1;
        public long MimeID = -1;
        public long FileID = -1;
        public string ItemValue = null;
        public string ItemOrigin = null;
        public int ItemRevert = 0;
        public int ItemReview = 0;
        public DateTime ItemCreate = DateTime.MinValue;
        public DateTime ItemAudit = DateTime.MinValue;
        //
    }
    //
}
//
